package day12.reflect;

import org.junit.Test;

public class Demo {

    @Test
    public void test(){
        //通过.class获得Student.class 字节码对象  -->返回Class类对象
        Class<?> clazz = Student.class;
        System.out.println(clazz);
    }

    @Test
    public void test2(){
        //通过Object类的getClass方法获得类对象
        Student s = new Student();
        Class<?> class1 = s.getClass();
        System.out.println(class1);
    }

    @Test
    public void test3() throws ClassNotFoundException {
        //通过Class.forName("类的全限定名");
        Class<?> class1 = Class.forName("day12.reflect.Student");
        System.out.println(class1);
    }
}
